<!doctype>
<html>
	<head>
		<script>

var bool;
function aa() {
	if(bool) {
		var test = 'hello man'
	} else {
		console.log(test)
	}
	alert(test);
}

aa();


		</script>
	</head>
	<body>
			
	</body>
</html>